<!--客服悬浮窗-->
<?php
    $themeid = intval($_P['themeid']);
    if (empty($config)){
      $config =   \app\model\Theme::getConfig($themeid);
    }
    $kflink= cache_load('kflink');
	if(empty($kflink)){
		$res = yxcurl('https://oa.yixuan.net/app/index.php?i=2&c=entry&do=wxwork&m=yx99999&op=kflink&softname='.MODULE_NAME);
		$content = json_decode($res['content'],true);
		if($content['msg']=='ok'){
			$kflink = $content['data']['kflink'];
			cache_write('kflink',$kflink);
		}
	}
	$kflink .= $_P['m']."-".$themeid."-".$_G['member']['uid'];
	$config['is_show_service'] = intval($config['is_show_service']);
	$worker = db_get(t_worker,array('uid'=>$_G['member']['uid']),array('id','level'));
	if ($_G['companyname'] !='易宣软件'||empty($worker)||$worker['level']==4){
            $config['is_show_service'] = 3;
    }
?>
{if $config['is_show_service']==0||$config['is_show_service']==2}
<div class="toolbar-right" style="display: none;" id="show">
  <a href="{$kflink}" class="service" ></a>
</div>
{/if}
<style>
  .toolbar-right {
    width: 88px;
    height: 34px;
    position: fixed;
    right: 0;
    bottom: 145px;
    z-index: 100001;
    display: flex;
    box-shadow: 0 0 4px 0 #ccc;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 17px;
    border-bottom-left-radius: 17px;
    background-color: #3370ff;
  }
  .toolbar-right .service, .toolbar-right .feedback {
    display: inline-block;
    height: 35px;
    width: 75px;
    position: relative;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 68px;
  }
  .toolbar-right .service {
    background-image:url('');
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
  }
  .animation {
    /*animation-name: moveRight;*/
    /*animation-duration: 1s;*/
    /*animation-fill-mode: forwards;*/
  }
  @keyframes moveRight {
    0% {
      right: 0;
    }
    100% {
      right: -59px;
    }
  }
</style>
<script>
  const currentUrl = window.location.href;
  const result1 = currentUrl.match(/x_input/);
  const result2 = currentUrl.match(/op=getinfo/);
  if(result1==null&&result2==null){
    $('#show').show();
  }
  document.addEventListener("DOMContentLoaded", function() {
    setTimeout(function() {
      var movingDiv = document.querySelector(".toolbar-right");
      movingDiv.style.animation = "moveRight 1s forwards";
    }, 1000);
  });

</script>

<!--客服悬浮窗 end-->